home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / battimer.zip / BATTIMER.BAS next >
BASIC Source File  |  1988-06-18  |  2KB  |  33 lines

  1. 'DELAY TIMER PROGRAM
  2. 'Written by Curtis Harper
  3. '           LAKELAND RBBS-PC
  4. '           (502)527-7617
  5. '6-14-1988
  6. 'This program will wait 5 seconds and default to system if a key is
  7. 'not pressed.
  8.  
  9. 10 CLS                                                 'Clear Screen
  10. 20 T$ = TIME$                                          'Get current time
  11.    S = VAL(MID$(T$, 7, 2))                             'Get current seconds
  12.    S = S + 5                                           'Add 5 seconds
  13.    IF S > 60 THEN S = S - 60                           'Offset for 56 to 59 seconds
  14.    MID$(T$, 6, 3) = STR$(S)                            'Create seconds string
  15.    MID$(T$, 6, 1) = ":"
  16.    S = 5                                               'Set on screen seconds
  17.    I$ = MID$(TIME$, 7, 2)                              'Get current time seconds
  18. 25 LOCATE 4, 15: PRINT "PROGRAM WILL START UNLESS ANY KEY IS PRESSED IN "; S; " SECONDS"
  19. IF MID$(TIME$, 7, 2) <> I$ THEN                        'Check for seconds change
  20.    I$ = MID$(TIME$, 7, 2)                              'If different seconds
  21.    S = S - 1
  22.    END IF
  23. 30 IF MID$(T$, 7, 2) = MID$(TIME$, 7, 2) THEN GOTO 80  'Check for 5 sec timeout
  24.    IF INKEY$ = "" THEN GOTO 25                         'Check for key press
  25. 70 OPEN "TIME.BAT" FOR OUTPUT ACCESS WRITE AS #1       'Create TIME.BAT file
  26.    PRINT #1, "TIME TRIP"
  27.    CLOSE #1
  28.    CLS
  29.    SYSTEM
  30. 80 CLS                                                 'No key pressed then begone!
  31.    SYSTEM
  32.  
  33.